package com.boot.main.service.impl;

import com.boot.main.entity.CcomLog;
import com.boot.main.mapper.CcomLogMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.concurrent.TimeUnit;

@Service
@Slf4j
public class LogService {
    @Resource
    private CcomLogMapper logMapper;
    @Async
    public void saveLog(CcomLog log){
        try {
//            TimeUnit.MILLISECONDS.sleep(2000);
            logMapper.saveLog(log);
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
